<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/22
 * Time: 14:28
 */
namespace app\api\validate;

use think\Validate;

class Smsapi extends Validate{
    protected $rule = [
        'account'   => 'require',
        'password'  => 'require',
        'mobile'    => 'require|max:1000',
        'content'   => 'require',
        'signature' => 'require',
        'order_id'  => 'max:32',
        'ext_code'  => 'number',
        'at_time'   => ['regex'=>'/^([12]\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[0-1])([0-1]\d|2[0-4])([0-5]\d)$/']
    ];
    protected $message  =   [
        'account.require'       => '账号不能为空',
        'password.require'      => '密码不能为空',
        'mobile.require'        => '号码不能为空',
        'mobile.max'            => '号码不能超过1000个',
        'content.require'       => '内容不能为空',
        'signature.require'     => '签名不能为空',
        'order_id.max'          => '订单号不能超过32个字符',
        'ext_code.number'       => '扩展码必须为数字',
        'at_time.regex'         => '定时时间格式错误'
    ];
}